<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <script>
        let data = {
            name:'lyx'
        };
        console.log(data.name);
        data.name = 'wwy';
        console.log(data.name);
        console.log(data.name);
        /* 
            打印结果：修改一个其他的也跟着变
                lyx
                wwy
                wwy
        */

        let data2 = {
            data(){
                return {
                    name:'lyx'
                }
            }
        };
        let d = data2.data();
        d.name = 'wwy';
        console.log(d.name);

        console.log(data2.data().name);
        console.log(data2.data().name);
        /* 
            打印结果：修改其中一个其他的不变
                wwy
                lyx
                lyx
        */
    </script>
</body>
</html>